<?php
class Merchant_Model_OrderShip
{

	private $_table;
	public function __construct(){
		$this->_table = new Merchant_Model_DbTable_OrderShip();
	} 


	public function getByValue($value,$field='orders_code'){
        $select = $this->_table->getAdapter()->select();
        $table  = $this->_table->info('name');
        $select->from($table,'*');
        $select->where("{$field} = ?",$value);
		$select->where(" os_status > 2 ");
		$select->order('os_id desc');
		return $this->_table->getAdapter()->fetchRow($select);
	}

	
	/**
	 *
	 */
	public  function updateByOrdersCode($row,$ordersCode)
	{		
		$where = $this->_table->getAdapter()->quoteInto("orders_code = ?",$ordersCode);
		return $this->_table->update($row,$where);
	}
	
}